package global

import (
	"MoSkeleton/framework"
	"go.uber.org/zap"
)

var (
	MoLogger            *zap.Logger      = new(zap.Logger)
	ConfigContainerInst *ConfigContainer = new(ConfigContainer)
)

var (
	configEvent *ConfigEvent
)

func BeforeInitSystem() {
	configEvent = new(ConfigEvent)
	if err := configEvent.OnBeforeInitSystem(); err != nil {
		MoLogger.Warn("before init system failed: ", zap.Error(err))
	}
}

func DoInitSystem() {
	MoLogger = framework.MoLogger
	if err := configEvent.OnInitSystem(); err != nil {
		MoLogger.Warn("onInit system failed: ", zap.Error(err))
	}
}

func AfterInitSystem() {
	if err := configEvent.OnAfterInitSystem(); err != nil {
		MoLogger.Warn("after system failed: ", zap.Error(err))
	}
}
